package javacode.chapter06;

import java.util.Scanner;

public class TestJavaScore {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        ClassScore[] classScores = new ClassScore[5];
        for (int i = 0; i < classScores.length; i++) {
            classScores[i] = new ClassScore();  // 这里要格外注意
            classScores[i].java = scanner.nextFloat();
        }
        JavaScore javaScore = new JavaScore();
        float avgJava = javaScore.getAvgJava(classScores);
        System.out.println("这5个学生的Java平均成绩是:" + avgJava);
    }
}
